package cn.jingzhuan.element.demo.view.adapter

import android.databinding.ViewDataBinding
import android.support.v7.widget.RecyclerView
import android.view.View
import cn.jingzhuan.element.element.R
import cn.jingzhuan.element.element.databinding.ItemLoadMoreBinding

class AdapterWrapper<T>(adapter: BaseBindingRecyclerAdapter<T>): BaseAdapterWrapper(adapter as RecyclerView.Adapter<RecyclerView.ViewHolder>) {

    override fun getLoadMoreItemLayoutId(viewType: Int): Int = R.layout.item_load_more

    override fun setLoadMoreVisiable(binding: ViewDataBinding, show: Boolean) {
        binding as ItemLoadMoreBinding
        binding.itemLoadPb.visibility = if (show) View.VISIBLE else View.GONE
    }

    override fun setLoadTipText(binding: ViewDataBinding) {
        binding as ItemLoadMoreBinding
        binding.itemLoadTv.text = "上拉加载更多"
    }

    override fun setLoadingText(binding: ViewDataBinding) {
        binding as ItemLoadMoreBinding
        binding.itemLoadTv.text = "正在加载"
    }

}